package cn.ecnu.user.service.impl;


import cn.ecnu.user.mapper.NotificationMapper;
import cn.ecnu.user.pojo.Notification;
import cn.ecnu.user.service.NotificationService;
import cn.ecnu.user.vo.NotificationFrontVo;
import cn.ecnu.user.vo.NotificationVo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class NotificationServiceImpl implements NotificationService {

    @Resource
    private NotificationMapper notificationMapper;


    @Override
    public int addNotificationByUid(NotificationFrontVo vo) {
        return notificationMapper.addNotificationByUid(vo);
    }

    @Override
    public List<Notification> getNotificationByUid(Integer uid) {
        return notificationMapper.getNotificationsByUid(uid);
    }

    @Override
    public int updateReadByNid(NotificationVo vo) {
        return notificationMapper.updateNtReadStatus(vo);
    }
}
